csvFileName=$1
headerN=`cat $csvFileName | iconv -f utf-8 -t gbk | head -n 1 | cut -d ',' -f 1- --output-delimiter $'\n' | awk 'END{print NR}'`
echo 字段数：$headerN
indexLine=1
for line in `cat $csvFileName`; do
    cp $csvFileName "temp"$csvFileName
    while [ `echo $line | cut -d ',' -f 1- --output-delimiter $'\n' | awk 'END{print NR}'` -lt $headerN ]; do
        line=$line","
    done
    line=`echo $line | iconv -f utf-8 -t gbk`
    sed $indexLine"c"$line "temp"$csvFileName > $csvFileName
    indexLine=$[$indexLine + 1]
    rm "temp"$csvFileName
done
